home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
FDATE68A.ARJ
/
FDATE.DOC
< prev
next >
Wrap
Text File
|
1992-07-30
|
68KB
|
1,709 lines
FDATE Version 6.8a Aug 01, 1992
===================================================================
FDATE: a utility for date manipulation in batch files.
===================================================================
Stephen Ferg 5113 N. 8th Road, Arlington, VA 22205-1201
Voice (703) 525-2241 CompuServe 73377,1157
=======================================================================
Format:
FDATE /Ffunc /Adate /Iformat /Pstring
/Bdate /Oformat /Sstring /Nnum /Ddayofweek
=======================================================================
FDATE PARAMETERS
================
The parameters that are required depend on the function requested.
Parameters that are specified, but not needed, are ignored.
Executing FDATE without any parameters displays a brief help screen.
Parameters can be in any order and upper or lower case.
Note that although function and format parms are not case
sensitive, they are "text sensitive". If any characters are
missing, added, or mistyped, the parameter will be rejected.
/F requests a particular FDATE function
If this parameter is not specified,
FDATE displays a help screen. If you unexpectedly get the help
screen displayed, you probably have omitted the /F parameter.
/N number of days (always a number)
/D day-of-week number (used only with W function)
/A date A (for date functions)
/B date B (for date functions)
If the /A parameter is omitted, /Atoday is assumed.
If the /B parameter is omitted, /Btoday is assumed.
/A number A (for math functions)
/B number B (for math functions)
/I specifies format of input date(s)
If the /I parameter is omitted, /Imm-dd-ccyy is assumed.
/O specifies format of output date
If the /O parameter is omitted, /Od1 is assumed.
/L specifies language of output.
/Lus US (American) English-language output
/Lfr French-language output
/Lsp Spanish-language output
If the /L parameter is omitted, /Lus [American English] is assumed.
/V specifies that output is to be placed in an environment variable
rather than written to standard output.
/P specifies a prefix string for the output
/S specifies a suffix string for the output
These optional parameters may always be specified or omitted.
They must be enclosed in single quotes, double quotes, or
square brackets
Note that "whitespace" will be removed from these strings,
so formatting of /P and /S strings cannot be controlled using
spaces. To format strings, use periods or ASCII 255 (hex'ff')
as filler.
EXAMPLES
FDATE /Ff /At /Od1 /P"Today is "
FDATE /Fdif /At /B12-25-TTTT /S" days until Christmas"
FDATE /Fdif /At /B12-25-TTTT /P"It is " /S" days 'til Xmas"
FDATE /Ff /A05-08-TTTT /S[ -- "Crazy Eddy's" birthday]
ERROR HANDLING
==============
If FDATE detects an error:
(1) it will return an errorlevel of 1 (rather than 0), and
(2) its output will be 3 lines:
* the word ERROR
* a DOS batch-file ECHO statement that displays an error message
* a DOS batch-file PAUSE statement
If Fdate output is displayed directly, or redirected to NUL:
you can detect an error by testing the errorlevel for a value of 1.
If Fdate output is piped to an environment manipulation utility such
as STRINGS or GET, the environment variable will be set to ERROR.
Errorlevel will be set by STRINGS/GET, and will probably be 0.
In such a case, the only way to detect an error is to test the
environment variable for the value ERROR.
If FDATE output is redirected to a batch file, which is then
CALLed to set an environment variable, the batch file will:
* set the environment variable to ERROR,
* ECHO the error message, and
* pause.
You can detect an error by testing errorlevel for the value 1
either before or after you CALL the batch file.
You can detect an error by testing the environment variable for the
value ERROR, AFTER you have CALLed the batch file.
----------------------------------------------------------------------
EXAMPLE:
rem use FDATE to check validity of year in parm %1
Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy /P"Received year parm: "
if errorlevel 1 echo Year parm [%1] is not valid.
if errorlevel 1 goto endit
EXAMPLE:
rem use FDATE to verify %1, and GET to put it into %year%
Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy | GET ZE /V%year% >nul
if (%year%)==(ERROR) echo Year parm [%1] is not valid.
if (%year%)==(ERROR) goto endit
EXAMPLE:
rem use FDATE to verify %1, call a batch file to put it into %year%
Fdate /Ff /Imm-dd-ccyy /ATT-TT-%1 /Occyy /P"@set year=">junktemp.bat
call junktemp.bat
del junktemp.bat
if errorlevel 1 echo Year parm [%1] is not valid.
if errorlevel 1 goto endit
SYMBOL CONVENTIONS
==================
The following symbols are used in specifying date formats:
SYMBOL EXAMPLE MEANING
------ ------- -------------------------------------
cc 19 century
yy 93 year
mm 02 month
zm 2 month without leading zero
dd 08 day
zd 8 day without leading zero
mn February month name
mn3 Feb month name, first 3 characters only
dow Tuesday day of week
dow3 Tue day of week, first 3 characters only
dow# 3 day of week as a number (Sunday=1, Monday = 2, etc.)
today is a "pseudodate" representing the current date
t is an alias for the "today" pseudodate
hh:mm 09:05 hours and minutes
hhmm 0905 hours and minutes
ss 09 seconds
PSEUDODATES
===========
t (or today)
can be used with either /A or /B, e.g. /Atoday or /At.
This is the default for both /A and /B. That is,
if for example /A is not specified, /At is assumed.
EXAMPLE
rem Get the date that is 90 days from today
FDATE /Fadd /N90 /Atoday /Omm-dd-ccyy
FDATE /Fadd /N90 /At /Omm-dd-ccyy
rem determine if this year is a leapyear
FDATE /Ff /At /OLY
tt when used in place of a 2-digit DD string, will cause
Fdate to use today's day-of-the-month.
Example: FDATE /Ff /Imm-dd-ccyy /A01-tt-1992 /Od1
tt when used in place of a 2-digit MM string, will cause
Fdate to use today's month.
Example: FDATE /Ff /Imm-dd-ccyy /Att-01-1992 /Od1
tt when used in place of a 2-digit YY string, will cause
Fdate to use today's year (CCYY).
Example: FDATE /Ff /Imm-dd-yy /A01-01-tt /Od1
Note that TT can NOT be used for only the YY part of a CCYY
input year. The following, for example, is NOT valid:
Example: FDATE /Ff /Imm-dd-ccyy /A01-01-19tt /Od1
tttt when used in place of a 4-digit CCYY string, will cause
Fdate to use today's year (CCYY).
Example: FDATE /Ff /Imm-dd-ccyy /A01-01-tttt /Od1
EXAMPLES:
Show the first Monday in the second quarter of this year
FDATE /Fw /Iccyymmdd /Atttt0301 /D2 /N1 /Od1 /P"First Monday in QTR#2: "
Show the last Friday on/before the 15th of this month.
FDATE /Fw /Iccyymmdd /Atttttt15 /D6 /N-1 /Od1 /P"Friday before the 15th: "
INPUT FORMATS
=============
NOTE
If ALL input dates are specified using the "today" pseudodate, (i.e.
/At, /Bt) then it is not necessary to supply an input format using /I.
-----------------------------------------------------------------------
FILE SPEC INPUT FORMATS
-----------------------------------------------------------------------
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
f MYFILE.1 Input format F (file) tells Fdate that
/A and /B will specify filenames, and that
Fdate should pick up the input date and time
from the date/time stamp on a file.
-------------------------------------------
Note that for functions which accept the /B
parm (e.g. comp, dif), it is not possible to
put a filename in /A and a date spec in /B.
If you specify /If, then both /A and /B will
be interpreted as filenames. The only
exception is the pseudodate "t" (i.e. /At or
/Bt) which will pick up the current date and
time from the system clock. This feature
will allow you, for example, to compare the
date of a file to today's date (see EXAMPLE
#10, below).
-------------------------------------------
The filename may (but need not) be fully
qualified: i.e. MYFILE.1 and
C:\DBASE\WORKDIR\MYFILE.1 are both
acceptable.
The filename may contain wildcards. If it
does, the date/time stamp will be retrieved
from the first file that Fdate finds that
meets the filespec. Giving FDATE a filespec
containing a wildcard is pretty useless, but
Fdate will not reject it.
-----------------------------------------------------------------------
CALENDAR DATE INPUT FORMATS
-----------------------------------------------------------------------
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
ccyymmdd 19922002
ccyy-mm-dd 1992-02-20 In an input format specification, the dash
1992/02/20 symbols represent ANY non-numeric symbol.
1992.02.20 Leading zeros MUST be present.
mm-dd-ccyy 02-20-1992 In an input format specification, the dash
02/20/1992 symbols represent ANY non-numeric symbol.
2-5-1992 Leading zeros need not be present.
2/5/1992
mm-dd-yy 02-05-92 February 5, 1992. See discussion of
2/5/92 FDATE'S CENTURY ASSUMPTION ALGORITHM, below
---------------------------------------
In the following formats, days
precede months (European style)
---------------------------------------
dd-mm-ccyy 05-02-1992 In an input format specification, the dash
05/02/1992 symbols represent ANY non-numeric symbol.
5-2-1992 Leading zeros need not be present.
5/2/1992
dd-mm-yy 05-02-92 February 5, 1992. See discussion of
5/2/92 FDATE'S CENTURY ASSUMPTION ALGORITHM, below
-----------------------------------------------------------------------
JULIAN DATE INPUT FORMATS
-----------------------------------------------------------------------
NOTE: * JJJ can actually be 1 - 4 digits
* may include a prefix of a plus or minus ( + or - ) sign
-----------------------------------------------------------------------
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
ccyyjjj 1992003 Third day of 1992, i.e. Jan 3, 1992
19923 Third day of 1992
tttt003 Third day of this year
tttt3 Third day of this year
yyjjj 92003 Third day of 1992
923 Third day of 1992
tt003 Third day of this year
tt3 Third day of this year
01003 Third day of 2001 See
FDATE'S CENTURY ASSUMPTION ALGORITHM, below
NOTE THAT FDATE WILL ACCEPT "JJJ" OF LESS THAN 1 & MORE THAN 366.
-----------------------------------------------------------------
yyjjj tt1000 the 1000th day from beginning of this year
tt0 last day of last year
tt-1 next-to-last day of last year
FDATE /Ff /Iccyyjjj /Od1 /A1992-1 produces... Monday December 30, 1991
FDATE /Ff /Iccyyjjj /Od1 /A19920 produces... Tuesday December 31, 1991
FDATE /Ff /Iccyyjjj /Od1 /A1992+1 produces... Wednesday January 1, 1992
FDATE /Ff /Iccyyjjj /Od1 /A1992366 produces... Thursday December 31, 1992
FDATE /Ff /Iccyyjjj /Od1 /A1992367 produces... Friday January 1, 1993
This feature allows limited date arithmetic with ordinary business
Julian days. For example, 90 days from tt300 can be shown by:
FDATE /Ff /Iyyjjj /Att390
FDATE'S CENTURY-ASSUMPTION ALGORITHM
====================================
If an input date is supplied in a format in which the year is
specified without a century -- that is, as YY rather than CCYY --
then Fdate does not automatically use the current century.
Instead,
* if YY is greater than 20, then FDATE assumes CC = 19
* if YY is less than or equal 20, then FDATE assumes CC = 20
Examples:
21 becomes 1921
...
99 becomes 1999
00 becomes 2000
01 becomes 2001
...
20 becomes 2020
but then (again)
21 becomes 1921
To put it simply, FDATE makes what would be a reasonable assumption
about the century for someone operating in the 1990's: it looks back to
1921 and forward to 2020. If both I and FDATE are still alive in the
year 2000, I'll probably update FDATE's century-assumption algorithm to
shift it forward several decades.
OUTPUT FORMATS
==============
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
dd-mn3-yy 08-Feb-92 CompuServe-style date
yy 93 2-digit year number
ccyy 1993 4-digit year number (includes century)
ccyymm 199302 useful for triggering monthly processing
ccyymmdd 19930208 useful for putting current date in filename
yymmdd 908208 useful for putting current date in filename
mmdd 0208
mm 02 2-digit month number
dd 08 2-digit day-of-month number
zd 8 day-of-month number, no leading zeros.
In the following formats, months precede days (American style)
------------------------------------------------------------------
mm/dd/ccyy 02/08/1993
mm-dd-ccyy 02-08-1993
mm.dd.ccyy 02.08.1993 British-style dates
zm/zd/ccyy 2/8/1993 no leading zeros in day or month
zm-zd-ccyy 2-8-1993 no leading zeros in day or month
zm.zd.ccyy 2.8.1993 British-style dates
mm/dd/yy 02/08/92
mm-dd-yy 02-08-92
mm.dd.yy 02.08.92 British-style dates
zm/zd/yy 2/8/92 no leading zeros in day or month
zm-zd-yy 2-8-92 no leading zeros in day or month
zm.zd.yy 2.8.92 no leading zeros in day or month
In the following formats, days precede months (European style)
------------------------------------------------------------------
dd/mm/ccyy 02/08/1993
dd-mm-ccyy 02-08-1993
dd.mm.ccyy 02.08.1993 British-style dates
zd/zm/ccyy 2/8/1993 no leading zeros in day or month
zd-zm-ccyy 2-8-1993 no leading zeros in day or month
zd.zm.ccyy 2.8.1993 British-style dates
dd/mm/yy 02/08/92
dd-mm-yy 02-08-92
dd.mm.yy 02.08.92 British-style dates
zd/zm/yy 2/8/92 no leading zeros in day or month
zd-zm-yy 2-8-92 no leading zeros in day or month
zd.zm.yy 2.8.92 British-style dates
------------------------------------------------------------------
Miscellaneous output formats
------------------------------------------------------------------
dow# 5 Sunday=1, Monday=2 .... Saturday=7.
dow Thursday name of day of week
Jeudi if /Lfr specified
dow3 Thu first 3 characters of name of day of week
Jeu if /Lfr specified
mn February name of month
Fevrier if /Lfr specified
mn3 Feb first 3 characters of name of month
Fev if /Lfr specified
ddmn3yy 05Feb92
------------------------------------------------------------------
LY 0 1 if year is a leapyear, otherwise 0.
------------------------------------
365 + this number gives total
number of days in the year.
28 + this number gives total
number of days in February.
------------------------------------
d1 Saturday, February 5, 1992
le Samedi 5 Fevrier 1992 [/Lfr specified]
t1 9:05 am
9:05 pm
HH:MM 09:05 24-hour time, hours:minutes
21:05
HHMM 0905
2105
HH:MM:SS 21:05:30 24-hour time, hours:minutes:seconds
HHMMSS 210530
full 9:05 pm on Wednesday February 5, 1992
9:05 pm, le Mercredi 5 Fevrier, 1992 [/Lfr specified]
9:05 pm, el miércoles 5 febrero, 1992 [/Lsp specified]
-----------------------------------------------------------------------
NOTE that the following formats contain embedded spaces. Consequently
they must be enclosed in double quotes. EXAMPLE: /O"mn zd, ccyy".
-----------------------------------------------------------------------
"zd mn ccyy" 5 February 1992
"zd mn, ccyy" 5 February, 1992
"mn3 dd ccyy" Feb 05 1992
"mn3 dd, ccyy" Feb 05, 1992
"mn zd, ccyy" February 5, 1992
"JULIAN" OUTPUT FORMATS
=======================
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
ccyyjjj 1992027 Jan 27, 1992
yyjjj 92027 BUSINESS "Julian date" expressed as number
jjj 027 of days since January 1 of the same year.
zzj 27 Note leading zero suppression in "zzj".
day# 727198 TRUE "Julian date" expressed as number
of days since January 1, 0001.
minute# 33088 "Julian minutes": time expressed as number
of minutes since midnight, January 1, 1990.
second# 633088 "Julian seconds": time expressed as number
of seconds since midnight, January 1, 1990.
----------------------------------------------------------------------
Running FDATE with /O parameter for a "Julian time" produces a
number based on the current time of day and the date in the /A parm.
If, on January 10, 1992 at 2 pm, you run FDATE this way:
FDATE /Ff /Atoday /Ominute#
it will produce the Julian minute for January 10, 1992 at 2 pm.
If, on January 10, 1992 at 2 pm, you run FDATE this way:
FDATE /Ff /A01-15-1992 /Imm-dd-ccyy /Ominute#
it will produce the Julian minute for January 15, 1992 at 2 pm.
----------------------------------------------------------------------
DATE FUNCTIONS
==============
FUNCTION FDATE /Ffunc /Adate /Iformat /Oformat
-------- -------------------------------------------
format this is a synonym for function "f"
f returns /Adate in format specified by /Oformat
Since /Aformat and /Oformat can be different, the FORMAT
function is used to change a date from one format to another.
Because of the wide variety of output formats, the FORMAT
function can also be used to determine the day of week of the
date, whether the date is in a normal or leap year, etc.
EXAMPLES
FDATE /Ff /A19920101 /Iccyymmdd /O"mn zd, ccyy"
FDATE /Ff /Atoday /Od1
FDATE /Fformat /Atoday /Od1
FDATE /Ff /If /Afdate.exe /P"FDATE.EXE last updated: " /Ofull
FUNCTION FDATE /Ffunc /Nnumdays /Adate /Iformat /Oformat
-------- -------------------------------------------
add Adds /Ndays to /Adate, produces date in /Oformat format
sub Subtracts /Ndays from /Adate, produces date in /Oformat format
EXAMPLES
FDATE /Fadd /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
FDATE /Fsub /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
FDATE /Fadd /N90 /Atoday /Od1
FUNCTION FDATE /Ffunc /Adate /Bdate /Iformat
-------- -------------------------------------------
comp compares the dates (time graularity = 1 day)
specified on the /A and /B parms.
returns when
LT /A is less than (earlier than) /B
EQ /A is equal to (same as) /B
GT /A is greater than (later than) /B
tcomp compares the times (time graularity = 1 second)
specified on the /A and /B parms.
This is useful when input format /If (file) is specified.
It can be used to compare the timestamps of two files and
determine which is older.
EXAMPLE: Fdate /Ftcomp /If /Amyfile.1 /Byourfile.1
returns when
LT /A is less than (earlier than) /B
EQ /A is equal to (same as) /B
GT /A is greater than (later than) /B
dif Returns number of days between /Adate and /Bdate
Order of the two dates is not significant.
Note that for DIF, both dates must be in the SAME
format, the input format specified in /Iformat.
If the two dates are not in the same format, reformat one
of the dates using the /Ff function and
a utility like STRINGS or GET.
EXAMPLES
FDATE /Fdif /A01-01-1992 /B11-11-1992 /Imm-dd-ccyy
FDATE /Fdif /A11-11-1992 /B01-01-1992 /Imm-dd-ccyy
FDATE /Fdif /Atoday /B01-01-1992 /Imm-dd-ccyy
FUNCTION FDATE /Ffunc /Adate /Iformat /Oformat /Ddow# /Ndow-count
-------- -----------------------------------------------------------
w W (weekday) function.
This function accepts a date specification in parm /A and
returns the date of the /Nth /Day-of-the-week
before or after /Adate. For example:
If /A specifies November 14, 1992
/D specifies the number for Thursday (i.e., 5)
/N specifies a week count of 3
then /Fw returns the date of the third Thursday after
November 14, 1992. (See full example, below)
Note that /N may be negative. If, in the above example, /N
is specified as -3, then Fdate returns the date of the third
Thursday BEFORE November 14, 1992.
If the date specified on the /A parms falls on the same day
of the week as was specified on the /D parm, then that will
be considered to be the first date meeting that day-of-week
criterion. That is, If November 14, 1992 fell on a
Thursday, and if /N was 1 or -1, then the output date would
be the same as the input date, i.e. November 14, 1992.
The acceptable values for /N (number of weeks) is in
the range of 99..-99. A value of zero (i.e. /N0) is invalid.
EXAMPLES
find date of Thanksgiving (4th Thursday in November) in 1992
FDATE /Fw /A11-01-1992 /Imm-dd-ccyy /D5 /N4 /Od1
returns: Thursday November 26, 1992
find the beginning of the work-week (Monday, 2nd day of week)
AFTER Thanksgiving, 1992
FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N1 /Od1
find the beginning of the work-week (Monday, 2nd day of week)
BEFORE Thanksgiving, 1992
FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N-1 /Od1
ECHO FUNCTION
=============
e Produces only the strings specified using the /P and /S
parameters.
The primary use of /Fe is to:
(1) set an environment variable to a symbol it would not
ordinarily accept (such as "=")
(2) to pipe symbols that ordinarily cannot be piped (such as the
redirection symbol ">" and the pipe symbol "|").
Other functions, such as /Ff, can also do this. The special use
of /Fe is for situations in which you don't want the output to
include a date.
EXAMPLE BATCH FILE
------------------
@ECHO OFF
set pct=%%%
Fdate /Fe /P"=Sam=" /vName
Fdate /Fe /P"echo ECHO Hi, %pct%Name%pct%!>junk2.bat">junk1.bat
: RESULT: TEXT OF JUNK1.BAT IS
: echo ECHO Hi, %Name%!>junk2.bat
call junk1.bat
: RESULT: TEXT OF JUNK2.BAT IS
: ECHO Hi, =Sam=!
call junk2.bat
: RESULT: TEXT DISPLAYED ON SCREEN IS
: Hi, =Sam=!
:endit
MATH FUNCTIONS
==============
FUNCTION FDATE /Ffunc /Anum /Bnum
-------- -------------------------------------------
#add returns the sum of the integers specified
on the /A and /B parms. Can be used to calculate the
"Julian" minute(second, date) in the future from a given
"Julian" minute(second, date). Also useful in generating
sequences of numbers and looping (see EXAMPLE #11, below).
#sub (not supported)
no numeric subtraction operation (as such) is supported.
Often, you will find that #dif will do what you want.
#dif is the same as subtraction in which the smaller
number is subtracted from the larger number; it will never
return a negative number. If you really MUST have
subtraction, which might return a negative result, you can
add two numbers, one of which is a negative number.
For example, to subtract 3 from 2:
FDATE /F#add /A2 /B-3 [ returns: -1 ]
#dif returns the difference between the integers specified
on the /A and /B parms. Can be used to calculate the
number of minutes(seconds, days) between two
"Julian" minutes(seconds, dates).
#comp compares the integers specified on the /A and /B parms.
returns when
LT /A is less than /B
EQ /A is equal to /B
GT /A is greater than /B
PUTTING FDATE OUTPUT INTO AN ENVIRONMENT VARIABLE USING /V
===========================================================
Starting with version 6.1, Fdate supports a /V (environment variable)
parameter. A user can use /V to tell Fdate to put its output directly
into an environment variable. (Fdate attempts to put output into an
environment variable in the master, rather than the local, environment.)
Note that due to the complexities of manipulating the environment, /V
may not always work. If you encounter a situation in which it does not,
you may be able to use one of the alternative techniques described in
the next section. For a list of environments in which the /V option has
been reported as NOT working, see the next section.
/Vevar tells Fdate to put output into an environmental variable
whose name is "evar". For example:
Fdate /Ff /Vdate1
will set the environment variable DATE1 to the current date. If
you type SET at the DOS prompt, you should see something like:
DATE1=Friday February 14, 1992
If you specify /V without an evar name, the evar name defaults to FDATE.
Example : Fdate /Ff /V
produces: FDATE=Friday February 14, 1992
If you do not use /V, Fdate output is written to standard output, that
is, to the screen.
PUTTING FDATE OUTPUT INTO AN ENVIRONMENT VARIABLE WITHOUT USING /V
===================================================================
Manipulating the environment is an incredibly tricky business. There
are questions of the local versus master environment, the version of DOS
you are running, and the environment under which you are running (DOS,
Windows, Carousel). In order to keep FDATE focussed on date-related
issues, versions of Fdate prior to 6.1 did not attempt to put output
directly into an environment variable. Instead, FDATE's output was
written to standard output, that is, it was displayed on the screen.
Output could then be redirected to a batch file, or piped to a utility
(such as STRINGS or GET), that would put the output into an environment
variable.
Starting with version 6.1, Fdate supports a /V (environment variable)
parameter. A user can use /V to tell Fdate to put its output directly
into an environment variable. HOWEVER.... due to the complexities of
environment manipulation, there may be circumstances where /V doesn't
work. These include running FDATE when you have shelled out to DOS from
another program, have put the command processor in upper memory (UMB)
(see below), are running under Windows, Carousel, etc. In such cases,
you will need to fall back on more basic methods.
One way to put FDATE's output into an environment variable is to use
the /P (prefix string) feature to create a DOS "SET" statement,
redirect the output to a batch file, and CALL the batch file.
Since CALL first appeared in DOS 3.3, you will need DOS 3.3 or
greater to use this technique.
FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET FDATE=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
There are also shareware and public domain utilities that are written
specifically to manipulate environment variables, and do that job very
well. FDATE's output can be put into an environment variable by piping
it to one of these utilities. When piping FDATE output to a utility,
you can prevent the output from being ECHOed to the screen by
redirecting the output to NUL.
EXAMPLE: use STRINGS to put date into DATE1 environment variable
FDATE /Ff /At /Od1 | STRINGS date1= ASK >NUL
-----------------------------------------------------------------
I recommend Bob Stephan's GET and PC Magazine's STRINGS.
As of February 14, 1992, the current version of GET is 2.5.
On CompuServe, use IBMFF to look for GET*.ZIP (e.g. GET25.ZIP for
version 2.5) in CIS:IBMSYS, or for GET.ZIP in ZNT:UTILFORUM, lib 16.
GET is also available from the Public Software Library in Houston.
As of February 14, 1992, the current version of STRINGS is 1.3.
On CompuServe, look for STRING.ZIP in the PC Magazine Utilities
Lib of ZNT:UTILFORUM. STRHYP.ZIP contains good hypertext
documentation on STRINGS.
-----------------------------------------------------------------
/V WHEN USING 4DOS, NDOS, AND UMB
=================================
--------------------------------------------------------------
I have received the following report from Aran Spence about
circumstances in which FDATE /V will not set a variable
in the master environment. This report leads me to believe
that FDATE /V may also fail to work with MS-DOS if you put
the command processor or the environment in Upper Memory.
--------------------------------------------------------------
Steve,
There are options with 4DOS and NDOS to load the environment and part
of the command processor into upper memory blocks. When one of these
options is used, FDATE /V can't find the environment and produces the
message:
ERROR
echo ERROR: Master environment not found
pause
If you have a 4DOS.INI file, it has to contain these lines for FDATE /V
to work:
UMBEnvironment = No
UMBLoad = No
If you have NDOS, the SHELL statement in CONFIG.SYS cannot contain
any reference to UMB loading via /U (which puts NDOS.COM in UMB), nor
can it contain a statement of the form:
/E:xxxU
(which puts xxx bytes of the environment in UMB via the "U" parameter).
Also, NSTART.BTM or 4START.BTM cannot contain
SET NDSHELL=/e+xxxU /U
in which both U's represent UMB loading of the command processor and the
environment during secondary shells.
=======================================================================
EXAMPLE #1
Redirect FDATE output to a file, or to a callable batch file,
or pipe it to STRINGS or GET to store it in an environment variable
=======================================================================
rem display Fdate output on screen
FDATE /Ff /At /Od1 /P"Today is "
rem Redirect FDATE output to a file
FDATE /Ff /At /Od1 /P"Today is " >FDATE.OUT
rem Redirect FDATE output to a callable batch file
FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET DATE1=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
rem Pipe FDATE output to STRINGS to store it in DATE1 environment var
FDATE /Ff /Atoday /O"mn zd, ccyy" |STRINGS date1= ASK >NUL
rem Pipe FDATE output to GET to store it in DATE1 environment var
FDATE /Ff /Atoday /O"mn zd, ccyy" |GET ZE /Vdate1 >NUL
=======================================================================
EXAMPLE #2
Find the difference (in days) between two dates in different formats
Use GET to put FDATE output into environment variables.
=======================================================================
set date1=05-10-1992
rem reformat date literal into same format as date1
FDATE /Ff /Imm-dd-yy /A05-08-92 /Omm-dd-ccyy | GET ZE /Vdate2>NUL
rem get difference between date1 and date2
FDATE /Fdif /Imm-dd-ccyy /A%date1% /B%date2%| GET ZE /vdiff>NUL
echo The difference is %diff% days.
=======================================================================
EXAMPLE #3
Schedule a program to run at a specified time in the future. Note that
this involves a lot of disk activity because DOS re-reads the batch
file from disk every time it does a GOTO LOOPTOP. If you do this, it
is a good idea to run the batch file from a RAM DISK.
=======================================================================
REM GET CURRENT JULIAN MINUTE AND PUT IN ENVIRONMENT VARIABLE RUNTIME
FDATE /Ff /At /Ominute# |STRINGS RunTime= ASK >NUL
REM ADD 120 MINUTES (2 HOURS) TO ENVIRONMENT VARIABLE RUNTIME
FDATE /F#add /A%RunTime% /B120 |STRINGS RunTime= ASK >NUL
REM LOOP UNTIL NOWTIME HAS REACHED RUNTIME
:LoopTop
FDATE /Ff /At /Ominute# |STRINGS NowTime= ASK >NUL
FDATE /F#comp /A%NowTime% /B%RunTime% |STRINGS TimeComp= ASK >NUL
if (%TimeComp%)==(LT) goto loopTOP
:LoopEnd
echo STARTING EXECUTION OF APPLICATION: [program name]
=======================================================================
EXAMPLE #4
Rename file BACKUP.LOG to a name that contains today's date
=======================================================================
FDATE /Ff /Atoday /Oyymmdd /P"@SET DATE1=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
ren BACKUP.LOG BK%DATE1%.LOG
SET DATE1=
=======================================================================
EXAMPLE #4b
Use FDATE to rename a log file to a name that will be unique within a
minute time-frame. This is a way to keep an historical record of a
series of log files. Since the file will retain its original date/time
stamp, you will still be able easily to tell when it was created.
In this example, we use GET to put the FDATE output into
environment variable TEMPVAR.
=======================================================================
FDATE /FF /At /Ominute# | GET ZE /Vtempvar >nul
REN online.log %tempvar%.log
SET tempvar=
=======================================================================
EXAMPLE #5
Find calendar date corresponding to Julian date 1992:045
=======================================================================
FDATE /Ff /A1992045 /Iccyyjjj /Od1
=======================================================================
EXAMPLE #6
Check to see if parameter %1 is a valid year (CCYY)
=======================================================================
@echo off
rem determine if value sent in through parameter %1 is a valid year
Fdate /Ff /Imm-dd-ccyy /A01-01-%1 /Od1 >nul
if errorlevel 1 echo Parm 1 was not a valid year: %1
if errorlevel 1 goto endit
echo PUT YOUR BATCH PROCESSING HERE, USING YEAR VALUE OF: %1
:endit
=======================================================================
EXAMPLE #7
Find the 4th Thursday in November (Thanksgiving)
=======================================================================
Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving: "
=======================================================================
EXAMPLE #8
Show the number of the anniversary for some special event.
=======================================================================
SEE HOLIDAYS.BAT
=======================================================================
EXAMPLE #9
Run a program once a day, when you boot for the first time that day.
=======================================================================
@echo off
cls
REM -------------------------------------------------------------------
REM Run daily processing once a day. Put this code in AUTOEXEC.BAT.
REM This batch file requires DOS 3.3+, since it uses CALL.
REM -------------------------------------------------------------------
if not exist LastRun.BAT goto RunNow
REM LastRun.Bat will set env var LASTRUN to date AUTOEXEC was last run.
call LastRun.BAT
REM Compare today's date to date in LASTRUN
Fdate /Fcomp /Imm-dd-ccyy /At /B%LastRun% /P"@set COMP=">junktemp.BAT
call junktemp.BAT
del junktemp.BAT
IF (%COMP%)==(EQ) goto NoRun
REM if user reset system clock, today's date may be less than LASTRUN
IF (%COMP%)==(LT) goto NoRun
rem Daily processing hasn't been run today. Run it.
echo RUNNING ONCE A DAY PROCESSING: Job 1
echo RUNNING ONCE A DAY PROCESSING: Job 2
echo RUNNING ONCE A DAY PROCESSING: ............. etc.
rem ------------------------------------------------------------------
rem Save today's date in a new version of LastRun.BAT
rem Note that this will be executed only if daily processing runs to
rem completion without hanging the machine or aborting the batch file.
rem ------------------------------------------------------------------
Fdate /Ff /Omm-dd-ccyy /At /P"@set LastRun=">LastRun.BAT
:NoRun
set LastRun=
set COMP=
=======================================================================
EXAMPLE #10
Use the ability to compare a file's date to today's date to
display a list of all files that were created/updated today.
See also demo batch file FILEDATE.BAT
=======================================================================
@echo off
if (%1)==(SUBROUTINE1) goto %1
CLS
ECHO THE FOLLOWING FILES WERE CREATED/UPDATED TODAY
REM the batch file calls itself, and passes control to SUBROUTINE1
REM which will display the filename if the file was updated today
for %%v in (*.*) do CALL %0 SUBROUTINE1 %%v
set comp=
del JUNKTEMP.BAT
goto endit
:SUBROUTINE1
rem Note that when SUBROUTINE1 is executed, %2 will contain a filename
rem Compare today's date to the date on the %2 file
Fdate /Fcomp /If /At /B%2 /P"@set COMP=">JUNKTEMP.BAT
CALL JUNKTEMP.BAT
rem Echo the filename if the file was created/updated today
if (%comp%)==(EQ) echo %2
:endit
=======================================================================
EXAMPLE #11
Use #add function to loop through an array of subscripted
environment variables.
=======================================================================
@echo off
cls
SET pct=%%%
SET prefix=Address
ECHO LOADING AN ARRAY
SET subscript=1
SET %prefix%.%subscript%=Stephen Ferg
SET subscript=2
SET %prefix%.%subscript%=5113 N. 8th Road
SET subscript=3
SET %prefix%.%subscript%=Arlington, VA 22205
ECHO UNLOADING AND DISPLAYING THE ARRAY
SET subscript=1
:LoopTop
REM do while subscript less than/equal 3
if %subscript%==4 goto LoopEnd
REM put value of subscripted variable into tempvar
ECHO SET tempvar=%pct%%prefix%.%subscript%%pct%>JUNKTEMP.BAT
CALL JUNKTEMP.BAT
REM display value of subscripted variable
ECHO %prefix%.%subscript% is: %tempvar%
REM delete subscripted variable
SET %prefix%.%subscript%=
REM increment the loop variable
Fdate /F#add /A%subscript% /B1 /Vsubscript
goto LoopTop
:LoopEnd
SET pct=
SET tempvar=
SET prefix=
SET subscript=
DEL JUNKTEMP.BAT
FDATE'S ALGORITHMS
==================
FDATE IS DESIGNED FOR BUSINESS, NOT HISTORICAL, APPLICATIONS
============================================================
FDATE is intended for business applications, not historical ones.
As far as FDATE is concerned, the calendar has followed the same
pattern, unchanged, since January 1, 0001.
-------------------------------------------------------------------
FDATE does not take into account historical changes in the calendar
such as the glitch in English dates that occurred when Britain
moved from the Julian to Gregorian calendar in the 18th century,
or Russia made the same move in the early 20th century.
-------------------------------------------------------------------
FDATE'S BASE DATE
=================
Internally, date manipulations are based on translating a calendar
date into an "absolute" or "TRUE Julian" date: a date expressed
as the number of days from some day in the distant past.
FDATE's base date is January 1, 0001 (i.e. day 1 of month 1 of year 1)
FDATE's absolute date for January 1, 0001 is 1.
FDATE's absolute date for January 1, 1992 is 727198.
FDATE'S LEAP YEAR ALGORITHM
===========================
Every year evenly divisible by 4 IS a leap year
EXCEPT THAT
Every year evenly divisible by 100 IS NOT a leap year
EXCEPT THAT
Every year evenly divisible by 400 IS a leap year
.
Using this algorithm
1983 is not a leap year
1984 is a leap year
1900 is not a leap year
2000 is a leap year
See "A Machine Algorithm for Processing Calendar Dates", by
Henry F. Fliegel (Georgetown University Observatory) and
Thomas C. Van Flandern (U.S. Naval Observatory)
COMMUNICATIONS OF THE ACM, Volume 11, Number 10, October 1968
There is supposedly a new adjustment to the leapyear algorithm,
which specifies the additional exception:
EXCEPT THAT
Every year evenly divisible by 4000 IS a leap year
See "Bit By Bit" column, COMPUTER LANGUAGE, November 1989, p. 148.
This adjustment is not part of FDATE's leapyear algorithm.
Unless your application is working with dates 2,000 years in the
future, the lack of this exception will be irrelevant for you.
DEMONSTRATION BATCH FILES
=========================
FDATE ships with a number of demonstration batch files. These are
sample applications that illustrate some of the ways that FDATE
might be used to build applications. They can be studied for
ideas for ways of using FDATE. They can also be used "as is", or
copied and customized to build applications that meet your own
special needs.
DEMONSTRATION BATCH FILE: HOLIDAYS.BAT
======================================
HOLIDAYS without any parameters displays events in current year.
HOLIDAYS with a year parameter displays events in that year.
EXAMPLE: HOLIDAYS displays events in current year
EXAMPLE: HOLIDAYS 1999 displays events in year 1999.
As the holidays are displayed, you can dump each screen display
to a printer by pressing SHIFT+PRINTSCREEN.
DEMONSTRATION BATCH FILE: ALARM
===============================
ALARM.BAT is like a simple alarm clock for your PC. ALARM.BAT waits
until a specified time, then triggers an alarm: it beeps and displays a
message. It continues until someone presses CONTROL-BREAK.
If you enter just "ALARM" at the DOS prompt, without any parameters,
ALARM displays a HELP screen that shows how to use it.
ALARM uses ANSI control codes to control screen color and cursor
placement, so it requires ANSI.SYS in order to work properly.
If you are not using ANSI.SYS, it will display some garbage
characters on your screen unless you modify the batch file to remove
the ANSI control codes.
USAGE : ALARM shows current time in hhmm format
USAGE : ALARM hhmm [msg] waits until hhmm, then sounds an alarm
EXAMPLE : ALARM 0930 [sounds alarm at 9:30 am]
EXAMPLE : ALARM 930 Staff meeting [sounds alarm at 9:30 am]
EXAMPLE : ALARM 1800 [sounds alarm at 6:00 pm]
For midnight, specify 0000 or 2400 for hhmm.
EXAMPLE : ALARM 2400 START MIDNIGHT BATCH RUN
The first thing that ALARM.BAT does is to change to the M: drive. M:
is presumed to be a RAM disk. Before you can use ALARM.BAT, you
should use your favorite text editor to change the RAM disk designation
to point to your own RAM disk. It is possible to run ALARM.BAT from a
normal hard disk or floppy, but because ALARM.BAT does a LOT of disk
activity, it is strongly recommended that you make your current
directory a RAM disk before running it.
To prevent repeated disk accesses to find the FDATE program, you
should also have FDATE on the RAM disk, or be using a cache.
USING ALARM TO CREATE RUN-IT
============================
You can copy ALARM.BAT to another batch file (say, RUN-IT.BAT) and
modify it so that rather than sounding an alarm it triggers other
activiites instead: runs a program or programs, or chains to another
batch file, for example.
To create a generalized RUN-IT.BAT, you could use the words of the
message to pass in the name of a batch file that you want to be run at
a certain time, along with its parameters. Make the triggered activity
this:
rem Note that earlier SHIFT has moved batch file name to parm 1.
rem run %1 batch file.
%1 %2 %3 %4 %5 %6 %7 %8 %9
Then entering this at the DOS prompt:
RUN-IT 0001 BACKUP.BAT C: D: E:
would cause RUN-IT to wait until 1 minute past midnight, then
run a batch file called BACKUP.BAT to backup drives C:, D:, and E:.
DEMONSTRATION BATCH FILE: TIC.BAT
=================================
TIC.BAT is a sample application that uses FDATE to create a "tickler
file" batch file. The default name for the file is C:\TICKLER.BAT.
In order to use TIC on a regular basis, you should:
* Use your favorite text editor to modify TIC.BAT so that it
will use your favorite text editor in the EDIT function.
(TIC.BAT ships with the editor set to SPFPC).
* If you wish, use your favorite text editor to modify the
first few lines of TIC.BAT, so the "SET TicBAT=" statement
sets TicBAT to a different file name for the tickler batch file.
Note that you must specify the full filename,
including path and extension.
* Put TIC.BAT in a directory that is in your PATH.
* add the following lines to your AUTOEXEC.BAT file:
CLS
rem show today's appointments
call TIC T
echo.
rem show tomorrow's appointments [note space betwee T and +1]
call TIC T +1
echo.
pause
This will cause the tickler batch file to be run when you
boot your computer, showing you your scheduled appointments.
HELP
====
Running TIC without any parms will cause it to display a HELP screen.
EXAMPLE: tic
ADDING A NEW TICKLE (SINGLE DATES)
==================================
To add a new SINGLE DATE tickle, invoke TIC. The first parm must be the
date of the desired tickle, in the format mm/dd/yy. (You may use the
pseudodate TT for the current month or year, if you wish.)
This parm must be followed by a description of the appointment.
* If no description is entered, TIC interprets the date in parm 1
as a request to display the tickles for that date.
NOTE: DOS batch files strip commas out of their input parameters, so
any commas in your description will be lost.
EXAMPLE: tic 5/5/92 Cinco de Mayo party w/ Susan: El Charro @ 6pm
EXAMPLE: tic 5/5/tt Cinco de Mayo party w/ Susan: El Charro @ 6pm
ADDING A NEW TICKLE (REGULAR WEEKLY APPOINTMENTS)
=================================================
To add a new REGULAR APPOINTMENT tickle, invoke TIC. The first two
parms must be the string "dow" (or "DOW") and the day-of-the-week
number of the day of the week (e.g. 2 for Monday).
These parms should be followed by a description of the appointment.
EXAMPLE: tic dow 2 Regular Monday morning staff meeting @ 8:30 am
EXAMPLE: TIC DOW 6 STANDING TENNIS DATE WITH JANICE AT 6:30
CHECKING YOUR TICKLES
=====================
You can check your tickler file appointments for a particular day at
any time by invoking TIC with only a date parm or the pseudodate T or
TODAY.
EXAMPLE: tic t displays appointments for today
EXAMPLE: tic today displays appointments for today
EXAMPLE: tic 5/5/92 displays appointments for May 5, 1992
EXAMPLE: tic 5/5/tt displays appointments for May 5 of this year
EXAMPLE: tic tt/5/tt displays appointments for the 5th of this month
You can check your tickler file appointments for a date from one to
seven days in the future by invoking TIC with two parms: T (for today)
followed by a number of +1 through +7. Unsigned numbers are treated
as if they have a plus sign. Negative numbers will show appointments
for days in the past.
EXAMPLE: tic t displays appointments for today
EXAMPLE: tic t 1 displays appointments for tomorrow
EXAMPLE: tic t +1 displays appointments for tomorrow
EXAMPLE: tic t +7 displays appointments for a week from today
EXAMPLE: tic t -1 displays appointments for yesterday
Note that the space between the first parm "T" and the second, number
parm, is required:
EXAMPLE: tic t+2 does not recognise "t+2" as "t +2".
Displays appointments for TODAY.
If the tickler batch file does not exist, nothing will be displayed.
REMOVING DEAD TICKLES
=====================
After a while the tickler batch file will become very long, filled with
"dead tickles". You can edit it with a text editor to remove the dead
tickles:
EXAMPLE: tic edit
EXAMPLE: TIC ED
or simply delete it and let TIC create a new one the next time
you use TIC to add a tickle.
USE AND DISTRIBUTION OF FDATE
=============================
FDATE is freeware, or what is known as "zero-cost shareware".
FDATE is not what is technically called "public domain" software
because the author retains the copyright. FDATE can, however,
be copied, used, and distributed freely as long as both FDATE.EXE
and its associated doc file (FDATE.DOC) and its demonstration batch
files (FDATEX.BAT, HOLIDAYS.BAT, TIC.BAT, ALARM.BAT) are not altered
and are distributed together.
FDATE can be included in shareware packages as long as both FDATE and
its related files are included in the shareware package.
If you have received FDATE as part of some larger shareware package,
please be aware that you may freely use, copy, and distribute FDATE
without paying a fee for, or registering, the larger package.
The author explicitly disavows any claim whatsoever about the
correctness or functionality of FDATE, its documentation, and its
demonstration batch files, and disclaims liability for anything and
everything bad that might happen in connection with, before, during, or
after using it. I have tried to make FDATE work right, but everybody
makes mistakes, so you use FDATE at your own risk.
I don't know if people will find FDATE useful, and I'd like to find
out. If you find FDATE useful and use it on a regular basis, I'd
appreciate it if you would drop me a short note via US mail or
CompuServe, telling me about how you are using FDATE.
If you need other input/output formats, or if you need a different
leapyear algorithm, please contact the author.
UPDATES AND CURRENT VERSION OF FDATE
====================================
You will always be able to find the most recent version of FDATE on
CompuServe. The filename will be FDATE.ZIP, and it will be available
in one of the libraries in the CIS:IBMSYS forum (probably library 1).
You can find it by using cross-library searching, looking for the
filename FDATE.ZIP or the keyword FDATE.
Feel free to post copies of FDATE.ZIP on any BBS that you wish, but
please do not upload it to any CompuServe library. As long as I am the
only one putting copies of FDATE onto CompuServe, we can keep confusion
over versions to a minimum.
The current distribution package (FDATE.ZIP) contains the following:
FDATE.EXE [the FDATE program]
FDATE.DOC [this file, documentation for FDATE]
[demonstration batch files]
FDATEX.BAT
HOLIDAYS.BAT
ALARM.BAT
DO-ONCE.BAT
FILEDATE.BAT
TIC.BAT
FDATE REVISION HISTORY
======================
Letters appended to version numbers indicate modifications to
the doc files, without any modification to the FDATE.EXE software.
Asterisks (*) indicate most important changes in the new version.
FDATE REVISION HISTORY
======================
Letters appended to version numbers indicate modifications to
the doc files, without any modification to the FDATE.EXE software.
Asterisks (*) indicate most important changes in the new version.
1.1 Oct 01, 1991
First version of FDATE
1.2 Oct 15, 1991
Replaced shareware date routines with Ferg routines
NOTE THAT THERE IS NOT MUCH ERROR-CHECKING IN THIS VERSION.
1.2d Oct 16, 1991
Minor changes to show redirection and piping of FDATE output
Revised discussion of how FDATE may be distributed.
Added note on business-related, non-historical purpose of FDATE
Added note on 4000-year leap-year exception
1.2e Oct 17, 1991
Added note on why FDATE doesn't directly set an Env variable
2.0a Nov 05, 1991
Modified Help display to show parameters and their meanings
Added output format YYMMDD
Added output format minute# and second#
Added function #dif
Added test of GET and STRINGS to FDATEX.BAT
Added test of minute# and second# to FDATEX.BAT
2.1a Nov 06, 1991
Added /P parameter and modified documentation accordingly
Added JULDATE output format
Minor changes and reformatting to documenation
2.2a Nov 08, 1991
Added example showing how to put current date in a filename
Added MMDD output formats
2.3a Nov 09, 1991
Added /L (language parameter) to allow French-language output
Added the following output formats
full
"mn3 zd, ccyy"
"zd mn, ccyy"
"zd mn ccyy"
European-style date formats
in which day occurs before month (e.g. dd/mm/ccyy)
2.4a Nov 10, 1991
Fixed display of time in /Ofull so that a minutes value of
less than 10 would display with a leading zero:
e.g. "10:08 am" instead of "10:8 am".
2.5a Nov 13, 1991
Added output format CCYYMM
2.6a Nov 25, 1991
Added function "F" (/Ff) as an synonym for /Fformat
Split FDATEX.BAT off from FDATE.DOC into its own file
2.6b Dec 02, 1991
Modified this doc file to reflect new /Ff feature
2.7a Dec 07, 1991
Added CompuServe-style output format: dd-mn3-yy.
Example: 07-Dec-91
2.8a Dec 08, 1991
Added output format d1. Example: Saturday December 7, 1991
Added output format t1. Example: 9:05 am
Added "t" alias for "today" pseudodate.
Corrected FDATE "help" display which had incorrectly shown
dd-mn3-yy as an input (rather than an output) format.
Modified documentation and FDATEX.BAT to reflect software changes.
Extensively re-wrote and re-arranged FDATEX.BAT to make it
more user-friendly.
In documentation:
corrected the formats for European dates, which had incorrectly
been shown as having the same format as American dates.
2.8b Dec 09, 1991
In documentation:
Added example showing how to use fdate to create a
time-stamped filename.
2.9a Dec 26, 1991
Added STRINGS and GET info to HELP screen.
In documentation:
Added example: how to find calendar date of Julian date
3.0a Dec 27, 1991
* =============== MAJOR BUG FIX ==============================
* Fixed bug in TRUEDATE date arithmetic routine that caused
* incorrect dates to be returned for the last 2 or 3 days of
* some months.
* ============================================================
Added output formats ccyy, hh:mm, and hh:mm:ss.
Replaced output format JULDATE with JULIAN
JULDATE retained for compatibility, but not documented.
Modified this doc file and FDATEX.BAT accordingly.
3.1a Dec 28, 1991
Fixed bug: error messages were ignoring the /P parm
added HOLIDAYS.BAT to distribution package
Replaced output format LEAPYR with LY
LEAPYR retained for compatibility, but not documented.
Added new feature: when an error is detected:
output string is "ERROR", and
errorlevel is set to 1.
Changed assumed century on input formats that require only YY.
Now, if year is LT/EQ 20, a century of 20 is assumed.
FDATE will now be able to function nicely until year 2020.
Modified this doc file and FDATEX.BAT accordingly.
3.2a Dec 29, 1991
Added COMP (date compare) function
Added RUN-ONCE-A-DAY example, which uses new COMP function
Added error-trapping for dates before year 1 and after year 9999.
Fixed minor error in HELP screen (dif does NOT require /O).
Modified this doc file and FDATEX.BAT accordingly.
3.2b Dec 30, 1991
Fixed two bugs in this doc file. (Thanks to Luther Schliesser
for the bug report.) My phone number was wrong, and the
values returned by the leapyear function (0,1) were reversed.
Fixed my phone number in the HELP screen.
Minor changes in the examples in this DOC file.
3.2c Dec 31, 1991
Fixed bug in HOLIDAYS.BAT that showed New Year's Eve when
it should have showed New Year's Day.
(Thanks to Luther Schliesser for ANOTHER bug report.)
Modified HOLIDAYS.BAT to show Easter-related holidays 1992-2000
Modified HOLIDAYS.BAT to give an example of calculating
anniversaries for a user-specified "special date" (SD)
4.1a Jan 03, 1992
* Added ability to accept TT, TT, and TTTT
as pseudodates for current MM, DD, and CCYY.
* Added function: W (i.e. /Fw)
Modified this doc file, FDATEX.BAT, and HOLIDAYS.BAT accordingly.
Modified HOLIDAYS.BAT to use new /Fw to show Thanksgiving.
Added Luther Schliesser's anniversary code to HOLIDAYS.BAT
Added note on elimination of multiple spaces from /P strings.
Added note showing how to use #add and negative number to do
true subtraction.
Added note: UPDATES AND CURRENT VERSION OF FDATE
4.2a Jan 04, 1992
In FDATE.EXE:
Minor change to improve readability of an error message
In FDATE.DOC:
* expanded discussion of how to check for errors using FDATE
added documentation for TIC.BAT
In HOLIDAYS.BAT:
added Easter days for 1991 and 2001, Epiphany, Pentecost, etc.
fixed bug in algorithm for Ash Wednesday (thanks to L. Schliesser)
changed "Memorial Day" , May 30
to "Memorial Day (observed)" , the last Monday in May
inspired by L.S.'s tickler for Sharon's birthday, added "tickler"
for 500th anniversary of Columbus' discovery of America
Added TIC.BAT to FDATE distribution ZIP file
Started practice of highlighting important changes with "*"
4.2b Jan 06, 1992
In HOLIDAYS.BAT:
Corrected algorithm for Advent (thanks to L. Schliesser)
Advent is the 4 Sundays BEFORE, but NOT including, Christmas.
(The error would not make any difference before 1994)
4.2c Jan 07, 1992
In HOLIDAYS.BAT:
Added LABOR DAY (thanks to L.S.)
In TIC.BAT
* Added ability to add regular day-of-week appointments
* Added EDIT function to make it easy to edit TICKLER.BAT
Removed 18-word limit on appointment descriptions
Added ANSI.SYS codes to make help screen show in color
4.3a Jan 12, 1992
* Added defaults for: /Adate, /Bdate, /I and /O
defaults are: /Atoday, /Btoday, /Imm-dd-ccyy , /Od1
* Added British-style output format, e.g. 1.15.1992 (Jan 15, 1992)
* Added output formats: dd, zd, hhmm, hhmmss
Added ability to process +1..+5 to TIC.BAT
added ALARM.BAT to FDATE.ZIP distribution package
4.4a Jan 20, 1992
* Added /S, suffix string parameter
modified CMDLIN unit to handle empty parms (e.g. /A ) better
Added Black History Month to HOLIDAYS.BAT to demonstrate /S
4.4b Jan 22, 1992
In TIC.BAT:
Fixed ability to list by date, which had been messed up when
adding ability to accept +1, etc. as parms
4.5a Jan 27, 1992
* Added julian formats JJJ, YYJJJ, CCYYJJJ
Made HELP screen display in bright white on blue
4.6a Jan 27, 1992
Fixed problem that prevented output from being redirected
4.7a Jan 28, 1992
Made HELP screen display in yellow & white
4.8a Jan 28, 1992
Added /D documentation to HELP screen display and FDATE.DOC
5.1a Feb 09, 1992
* Added julian INPUT formats yyjjj and CCyyjjj
Added documentation on Fdate's century-assumption algorithm
5.2a Feb 10, 1992
Relaxed the requirement that dates in JJJ must be zero-filled
on the left to occupy all 3 digits. JJJ can now be as
little as 1 character long, and as many as 4 characters.
5.3a Feb 13, 1992
Replaced "eng" language parameter with "us", in case
there might be a need to distinguish American-style
dates from British-style dates in the future.
6.1a Feb 14, 1992 *** MAJOR ENHANCEMENT ***
* Added /V parm, which allows a user to have Fdate itself set an
environment variable, rather than setting Evar by piping or
redirecting Fdate's standard output.
Added output formats MN (monthname) and MN3
Added demo batch file DO-ONCE.BAT to fdate distribution ZIP file
6.2a Feb 18, 1992 *** MAJOR ENHANCEMENT ***
* Added f (file) input format
* Added tcomp function
Added demo batch file FILEDATE.BAT to distribution ZIP file
Removed 80-byte limit on /P and /S parms.
6.2b Feb 22, 1992
Added Aran Spence's detailed report on the circumstances in which
/V doesn't work with 4DOS/NDOS.
Replaced /V with CALLs to batch files in all demo batch files,
so that users would not be handicapped by being
unable to use /V if they had loaded 4DOS high.
6.3a Mar 01, 1992
Minor fix to "full" output format, which was zero-filling hour
to left, producing e.g. "09:15 am" instead of "9:15 am".
6.4a Mar 18, 1992
Corrected help screen, which was incorrectly showing "f"
as an output format rather than an input format.
6.5a Mar 25, 1992
* Added Spanish language format: /Lsp
* Added input format : ccyy-mm-dd
* Added output formats:
ccyy/mm/dd ccyy-mm-dd ccyy.mm.dd
yy/mm/dd yy-mm-dd yy.mm.dd
Added output format: mm (2-digit month)
Added output format: zzj
Old name (julian) retained for compatibility.
* Changed TIC.BAT to use new input/output format ccyy-mm-dd.
This will help in sorting TICKLER.BAT properly at year-end.
NOTE THAT THIS WILL CAUSE TIC NOT TO RECOGNIZE DATES
IN AN EXISTING TICKLER.BAT FILE.
Use TIC EDIT
to edit the old TICKLER.BAT and change date formats.
6.6a Mar 27, 1992
* Added British/European input formats: dd-mm-yy and dd-mm-ccyy
Thanks for the request by Mr. Martin Brampton,
Moore Stephens Chartered Accountants, London
6.6b Mar 28, 1992
Added ALARM.BAT to FDATE.ZIP. It had been omitted from some
earlier distribution ZIP files.
6.6c Mar 30, 1992
Added EXAMPLE #11, showing subscripted E-vars and loops
6.7a Apr 05, 1992
* Added function "E" (echo)
* Added output format: "dd mn3 yy" EXAMPLE: 05 Sep 92
Added JDATE.BAT demo batch file to distribution package,
thanks to Aran Spence.
Corrected a bug in the routine that obtained command line
parameters. It sometimes caused an improper value to be
returned if a quoted parameter did not contain a space.
6.8a Aug 01, 1992
* I will no longer be posting the most recent version of FDATE
in ZNT:UTILFORUM because ZiffNet's new fees would require me
to pay $30/year to do so. Look for the most recent version
of FDATE in CIS:IBMSYS.
* Added output format: ddmn3yy EXAMPLE: 05Sep92
* Added output format: yy EXAMPLE: 92
This should make it easier for users to "roll their own"
date formats. For example, now that YY is available,
you could get ddmn3yy this way:
==================================
fdate /ff /odd | GET ze /vpart1
fdate /ff /omn3 | GET ze /vpart2
fdate /ff /oyy | GET ze /vpart3
set xdate=%part1%%part2%%part3%
echo today is %xdate%
==================================
* Modified documentation in JDATE.BAT to make it clear that it
is working with a BUSINESS julian date format: YYjjj.
Thanks for the feedback from Howard S. Friedman (70720,3022)
Updated FDATEX.BAT to test the new formats.